﻿
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta content="width=device-width, initial-scale=1" name="viewport" />
    <meta content="" name="description" />
    <meta content="" name="author" />
    <!-- BEGIN GLOBAL MANDATORY STYLES -->
    <link href="@Url.Content("~/assets/global/plugins/font-awesome/css/font-awesome.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/simple-line-icons/simple-line-icons.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/bootstrap/css/bootstrap.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/uniform/css/uniform.default.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css")" rel="stylesheet" type="text/css" />
    <!-- END GLOBAL MANDATORY STYLES -->
    <!-- BEGIN PAGE LEVEL PLUGIN STYLES -->
    @*<link href="@Url.Content("~/assets/global/plugins/gritter/css/jquery.gritter.css")" rel="stylesheet" type="text/css" />*@
    <!-- END PAGE LEVEL PLUGIN STYLES -->
    <!-- BEGIN PAGE STYLES -->
    <link href="@Url.Content("~/assets/admin/pages/css/tasks.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/select2/select2.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/bootstrap-datepicker/css/datepicker.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/clockface/css/clockface.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/bootstrap-datepicker/css/datepicker3.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/bootstrap-timepicker/css/bootstrap-timepicker.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/bootstrap-colorpicker/css/colorpicker.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/bootstrap-daterangepicker/daterangepicker-bs3.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/bootstrap-datetimepicker/css/datetimepicker.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/plugins/fancybox/source/jquery.fancybox.css")" rel="stylesheet" type="text/css" />
    <!-- END PAGE STYLES -->
    <!-- BEGIN THEME STYLES -->
    <link href="@Url.Content("~/assets/global/css/components.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/global/css/plugins.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/admin/layout/css/layout.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/admin/layout/css/themes/blue.css")" rel="stylesheet" type="text/css" id="style_color" />
    <link href="@Url.Content("~/assets/global/plugins/bootstrap-toastr/toastr.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/assets/admin/layout/css/custom.css")" rel="stylesheet" type="text/css" />
    <!-- END THEME STYLES -->
    <link rel="shortcut icon" href="favicon.ico" />

    <!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
    <!-- BEGIN CORE PLUGINS -->
    <!--[if lt IE 9]>
    <script src="@Url.Content("~/assets/global/plugins/respond.min.js")"></script>
    <script src="@Url.Content("~/assets/global/plugins/excanvas.min.js")"></script>
    <![endif]-->
    <script src="@Url.Content("~/assets/global/plugins/jquery-1.11.0.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/global/plugins/jquery-migrate-1.2.1.min.js")" type="text/javascript"></script>
    <!-- IMPORTANT! Load jquery-ui-1.10.3.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
    <script src="@Url.Content("~/assets/global/plugins/jquery-ui/jquery-ui-1.10.3.custom.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/global/plugins/bootstrap/js/bootstrap.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/global/plugins/jquery.blockui.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/global/plugins/jquery.cokie.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/global/plugins/uniform/jquery.uniform.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js")" type="text/javascript"></script>
    <!-- END CORE PLUGINS -->
    <!-- BEGIN PAGE LEVEL PLUGINS -->
    <script src="@Url.Content("~/assets/global/plugins/gritter/js/jquery.gritter.js")" type="text/javascript"></script>
    <!-- END PAGE LEVEL PLUGINS -->
    <!-- BEGIN PAGE LEVEL SCRIPTS -->
    <script src="@Url.Content("~/assets/global/plugins/bootstrap-toastr/toastr.min.js")"></script>
    <script src="@Url.Content("~/assets/global/scripts/metronic.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/admin/layout/scripts/layout.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/global/plugins/select2/select2.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/global/plugins/bootbox/bootbox.min.js")"></script>
    <script src="@Url.Content("~/assets/global/plugins/jquery-easypiechart/jquery.easypiechart.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/global/plugins/jquery.sparkline.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/admin/pages/scripts/index.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/assets/admin/pages/scripts/components-pickers.js")" type="text/javascript"></script>
    <!-- END PAGE LEVEL SCRIPTS -->


    <link href="~/Images/Calendar-icon.png" rel="shortcut icon" type="image/x-icon" />
    @*<link href="@Url.Content("~/Content/bootstrap.css")" rel="stylesheet" type="text/css" />
        <link href="@Url.Content("~/Content/bootstrap-theme.css")" rel="stylesheet" type="text/css" />
        <link href="@Url.Content("~/Content/bootstrap-select.css")" rel="stylesheet" type="text/css" />*@
    <link href="@Url.Content("~/Content/datepicker.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/loadingbar.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/tipsy.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/main.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/font-awesomes.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/jquery.treeview.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/font-flat/flaticon.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/sb-admin.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/lightbox.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/jqsimplemenu.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/jquery-ui.css")" rel="stylesheet" type="text/css" />

    @*@Styles.Render("~/Content/css")*@
    @Scripts.Render("~/bundles/modernizr")
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/underscore")
    @Scripts.Render("~/bundles/bootstrapjs")
    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("~/bundles/jmenu")
    @Scripts.Render("~/bundles/lightbox")
    @RenderSection("scripts", required: false)
    <script type="text/javascript" src="~/Scripts/tinymce/tinymce.min.js"></script>
    <script type="text/javascript" src="~/Scripts/danhmuc.js"></script>
    @*<script src="~/assets/global/scripts/bootstrap-datepicker.min.js" charset="utf-8"></script>*@
    <script src="~/assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
    <script src="~/assets/global/plugins/bootstrap-datepicker/js/locales/bootstrap-datepicker.vi.js" charset="utf-8"></script>
    <script src="~/Scripts/CheckDateTime.js"></script>
    <script src="~/Scripts/setup/setup.project.js"></script>

    <!-- END PAGE LEVEL SCRIPTS -->
    <script>
        jQuery(document).ready(function () {
            Metronic.init(); // init metronic core componets
            Layout.init(); // init layout
        });

    </script>
    <!-- END JAVASCRIPTS -->
    @*<style>
            .ui-dialog-titlebar{
                color:#4276A4;
            }
        </style>*@
</head>

<body class="page-header-fixed page-quick-sidebar-over-content">
    <div id="divLoading" style="display:none;z-index:1300;">
        <p style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 100; ">
            <img src="../Images/ajax-loader.gif" />
        </p>
    </div>
    <div class="page-header navbar navbar-fixed-top">
        <div class="page-header-inner">
            <div class="page-logo">
                <a href="@Url.Content("~/Home")">
                    <img src="@Url.Content("~/assets/images/logo1.png")" style="border:0px; margin-left:-10px;" title="Phần mềm quản trị hệ thống" />
                </a>
                <div class="menu-toggler sidebar-toggler hide">
                </div>
            </div>
            <a href="javascript:;" class="menu-toggler responsive-toggler" data-toggle="collapse" data-target=".navbar-collapse">
            </a>
            @{
                DHQGHN.PM0.GlobalInfo Info = new DHQGHN.PM0.GlobalInfo();
                if (HttpContext.Current.User.Identity.IsAuthenticated)
                {
                    if (Session["UserInfo"] != null)
                    {
                        Info = Session["UserInfo"] as DHQGHN.PM0.GlobalInfo;
                    }
                }
            }
            @if (Info.CountDay < 5)
            {
                <div class="page-logo" style="background-color:red;color:white;margin:0 auto;">
                    <ul style="padding-left: 0px;">
                    
                            <li style="list-style:none; width:200px; padding-top:10px;">
                                <i class="glyphicon glyphicon-warning-sign"></i>
                                Tài khoản còn @Info.CountDay ngày sử dụng
                            </li>
                    
                    </ul>
                </div>
            }
            <div class="top-menu">
                <ul class="nav navbar-nav pull-right">
                    <li class="dropdown dropdown-user">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-close-others="true" id="DisplayToggle">
                            <img alt="" class="img-circle" src="@Url.Content("~/assets/images/user.png")">
                            <span class="username">
                                @Info.FullName - @Info.User.UserName
                            </span>
                            <i class="fa fa-angle-down"></i>
                        </a>
                        <ul class="dropdown-menu">
                            <li class="eborder-top">
                                <a href="#" aria-hidden="true" role="menu" data-toggle="modal" data-target="#myModalView" onclick="ViewChangePassWord()"><i class="glyphicon glyphicon-user"></i> Thay đổi mật khẩu</a>
                            </li>
                            <li>
                                <a href="@Url.Content("~/Login/Logout")">
                                    <i class="icon-key"></i> Đăng xuất
                                </a>
                            </li>
                        </ul>
                    </li>
                    <!-- END USER LOGIN DROPDOWN -->
                </ul>
            </div>
        </div>
    </div>
    <div class="clearfix">
    </div>

    <div class="page-container">
        <div class="page-sidebar-wrapper">
            <div class="page-sidebar navbar-collapse collapse">
                @Html.Partial("~/Views/Shared/_MenuView.cshtml")
            </div>
        </div>
        <div class="page-content-wrapper">
            <div class="page-content">                
                @RenderBody()
            </div>
        </div>
    </div>
    @Html.Partial("~/Views/Shared/_NoticePartial.cshtml")
    <div id="dialog" title="Basic dialog">
    </div>
    <div class="page-footer">
        <div class="scroll-to-top">
            <i class="icon-arrow-up"></i>
        </div>
    </div>
</body>
</html>

<center>
    <div class="modal fade" id="myModalView" role="dialog">
        <div class="modal-dialog modal-lg">
            <div class="modal-content" style="width:500px;">
                <div class="modal-header" style="background-color: #2d6ca2;">
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                    <h4 class="modal-title" style="color:white;">Thay đổi mật khẩu</h4>
                </div>
                <div class="modal-body" id="control-content" style="width:500px;">

                </div>

            </div>
        </div>
    </div>
</center>

<script>
    @functions{
            public string GetAntiForgeryToken()
            {
                string cookieToken, formToken;
                AntiForgery.GetTokens(null, out cookieToken, out formToken);
                Session.Add("CurrentAntiForgeryToken", cookieToken + "," + formToken);
                return cookieToken + "," + formToken;
            }
        }
</script>

<script type="text/javascript">
    var x;
    var y;
    // JS cho toàn bộ trang
    $(document).ready(function () {
        $('.menu').jqsimplemenu();
        // Focus vào trường input đầu tiên
        setTimeout(function () { $('#search_form').find('input:text:visible:first').focus(); }, 500);

        $('#search_form').find('input:text:visible').attr('autocomplete', 'off');

        $('input.txtsearch').bind('keypress', function (event) {
            var keycode = (event.keyCode ? event.keyCode : event.which);
            if (keycode == 13 && OnCriteria) {
                OnCriteria(0);
            }
        });

        $('#DisplayToggle').click(function () {
            $('.dropdown-toggle').dropdown()
        });

        $(document).scroll(function (e) {
            x = e.pageX;
            y = e.pageY;
        });

    });

    function warning(dialogText, dialogTitle) {
        $('#dialog')
            .html(dialogText)
            .dialog({
                draggable: true,
                modal: true,
                resizable: false,
                //width: 'auto',
                title: dialogTitle || 'Confirm',
                minHeight: 75,
                minWidth: 175,
                buttons: [
                        {
                            text: "OK",
                            icons: {
                                primary: "ui-icon-close"
                            },
                            class: 'btn btn-primary',
                            click: function () {
                                $(this).dialog('destroy');
                            }

                        }
                ]

            });
    }

    function comfirmDelete(dialogText, okFunc, cancelFunc, dialogTitle) {
        //alert(x + " " + y);
        $('#dialog')
            .html(dialogText)
            .dialog({
                draggable: true,
                modal: true,
                resizable: false,
                width: 'auto',
                title: dialogTitle || 'Confirm',
                minHeight: 75,
                //autoOpen: false,
                //show: "blind",
                //hide: "explode",
                position: [x/2, y/3],
                buttons: [
                        {
                            text: "Đồng ý",
                            icons: {
                                primary: "ui-icon-heart"
                            },
                            class: 'btn btn-primary',
                            click: function () {
                                if (typeof (okFunc) == 'function') {
                                    setTimeout(okFunc, 50);
                                }
                                $(this).dialog('destroy');
                            }
                        },
                        {
                            text: "Bỏ qua",
                            icons: {
                                primary: "ui-icon-close"
                            },
                            class: 'btn btn-primary',
                            click: function () {
                                if (typeof (cancelFunc) == 'function') {
                                    setTimeout(cancelFunc, 50);
                                }
                                $(this).dialog('destroy');
                            }

                        }
                ]

            });
    }

    var datepicker = {
        register: function (id) {
            $("#" + id).datepicker({
                language: 'vi',
                autoclose: true,
                todayHighlight: true
            })
        }
    }

    var messager = {
        confirmUnuse: "Bạn có chắc chắn muốn ngừng sử dụng bản ghi này không?",
        selectRecord: "Cần chọn bản ghi muốn ngừng sử dụng!",
        restoreRecord: "Bạn có chắc chắn muốn khôi phục bản ghi này không?"
    }

    var keypress = {
        register: function (id) {
            $('#' + id).on("keypress", function (e) {
                var c = e.keyCode || e.which;
                if (c != 46 && c != 36) {
                    return false;
                }
            });
        }
    }

    function disableButton(className) {
        $("." + className).prop('disabled', true);
    }

    function ViewChangePassWord() {
        $.ajax({
            url: "@Url.Action("AccountChangePass", "Users")",
            async: false,
            type: "Post",
            dataType: "html",
            headers: {
                'VerificationToken': "@GetAntiForgeryToken()"
            },
            success: function myfunctionSuccess(data, textStatus, jqXHR) {
                $('#control-content').html(data);
            },
            error: function (jqXHR, textStatus, errorThrown) {
                alert('Có lỗi xảy ra trong quá xử lý: ' + errorThrown);
            }
        });
    }

</script>
